package com.uriuniv.dao;

import java.sql.SQLException;
import java.util.List;

import org.springframework.jdbc.core.JdbcTemplate;

import com.uriuniv.domain.Group;
import com.uriuniv.domain.Student;
import com.uriuniv.domain.University;
import com.uriuniv.mapper.GroupM;
import com.uriuniv.mapper.StudentM;
import com.uriuniv.mapper.UniversityM;

public class GroupD {

	private JdbcTemplate jdbcTemplate;

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}
	
	public Group getGroupByName(String groupName) throws SQLException {
		final String GROUP = "SELECT * FROM USER_GROUP WHERE GROUP_NAME = '" + groupName + "'";
		Group group = (Group)jdbcTemplate.queryForObject(GROUP, new GroupM());
		return group;
	}
	
}
